/*
 * OREKIT-X
 * Copyright 2002-2008 CS Communication & Systemes
 * 
 * Parts of this software package have been licensed to CS
 * Communication & Systemes (CS) under one or more contributor license
 * agreements.  See the NOTICE file distributed with this work for
 * additional information.
 *  
 * This is an experimental copy of OREKIT from www.orekit.org.
 * Please use the original OREKIT from orekit.org for normal work
 * unrelated to this research project.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License.  You
 * may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.  See the License for the specific language governing
 * permissions and limitations under the License.
 */
package ore.forces;

import ore.SpacecraftState;
import ore.forces.drag.DragSensitive;
import ore.forces.radiation.RadiationSensitive;

import org.apache.commons.math.geometry.Vector3D;

/** 
 * This class represents the features of a simplified spacecraft.
 * 
 * The model of this spacecraft is a simple spherical model, this
 * means that all coefficients are constant and do not depend of the
 * direction.  It is a simple container that returns the values set in
 * the constructor.
 *
 * @author &Eacute;douard Delente
 * @author Fabien Maussion
 */
public class SphericalSpacecraft 
    extends Object
    implements RadiationSensitive, DragSensitive
{

    /** 
     * Cross section (m<sup>2</sup>).
     */
    private double crossSection;
    /** 
     * Drag coefficient.
     */
    private double dragCoeff;
    /** 
     * Absorption coefficient.
     */
    private double absorptionCoeff;
    /** 
     * Specular reflection coefficient.
     */
    private double reflectionCoeff;


    /** 
     * @param crossSection Surface (m<sup>2</sup>)
     * @param dragCoeff Drag coefficient
     * @param absorptionCoeff coefficient Absorption coefficient
     * @param reflectionCoeff Specular reflection coefficient
     */
    public SphericalSpacecraft(double crossSection, double dragCoeff,
                               double absorptionCoeff, double reflectionCoeff) {

        this.crossSection = crossSection;
        this.dragCoeff = dragCoeff;
        this.absorptionCoeff = absorptionCoeff;
        this.reflectionCoeff = reflectionCoeff;
    }


    /** {@inheritDoc}
     */
    public double getDragCrossSection(SpacecraftState state, Vector3D direction) {
        return this.crossSection;
    }
    /** {@inheritDoc}
     */
    public Vector3D getDragCoef(SpacecraftState state, Vector3D direction) {
        return new Vector3D(this.dragCoeff, direction);
    }
    /** {@inheritDoc}
     */
    public Vector3D getAbsorptionCoef(SpacecraftState state, Vector3D direction) {
        return new Vector3D(this.absorptionCoeff, direction);
    }
    /** {@inheritDoc}
     */
    public double getRadiationCrossSection(SpacecraftState state, Vector3D direction) {
        return this.crossSection;
    }
    /** {@inheritDoc}
     */
    public Vector3D getReflectionCoef(SpacecraftState state, Vector3D direction) {
        return new Vector3D(this.reflectionCoeff, direction);
    }
    /** 
     * @param crossSection Cross section (m<sup>2</sup>)
     */
    public void setCrossSection(double crossSection) {
        this.crossSection = crossSection;
    }
    public void setDragCoeff(double dragCoeff) {
        this.dragCoeff = dragCoeff;
    }
    public void setAbsorptionCoeff(double absorptionCoeff) {
        this.absorptionCoeff = absorptionCoeff;
    }
    public void setReflectionCoeff(double reflectionCoeff) {
        this.reflectionCoeff = reflectionCoeff;
    }
}
